
<?php
include_once("connect.php");
$id=1;
$query=mysql_query("select * from order_user where id=$id");
$rs=mysql_fetch_array($query);

$email=$rs['email'];
$idc_name=$rs['idc_name'];
$sex=$rs['sex'];
$country=$rs['country'];
$city=$rs['city'];
$address=$rs['address'];
$postcode=$rs['postcode'];
$tel=$rs['tel'];
$qq=$rs['qq'];
$updat_time=$rs['updat_time'];
?>
<div class="fanbox">
    <h3>我的帐户-修改</h3>
    <form id="edit_form" action="order_user_do.php?action=edit" method="post">
        <table width="100%" cellpadding="0" cellspacing="0" class="post_table">
            <tr>
                <td width="30%" align="right">登录帐号(邮件)：</td>
                <td><?php echo $email; ?>
				<input type="hidden" class="input2" name="email" maxlength="50" value="<?php echo $email; ?>" />
				<input type="hidden" class="input2" name="id" maxlength="50" value="<?php echo $id; ?>" />
				</td>
            </tr>
            <tr>
                <td align="right">姓名：</td>
                <td><input type="text" class="input2" name="idc_name" maxlength="30" value="<?php echo $idc_name; ?>" /></td>
            </tr>
            <tr>
                <td align="right">性别：</td>
                <td>
                <select name="sex">
                    <option value="1">男</option>
					<option value="2">女</option>
                </select>
                </td>
            </tr>			
            <tr>
                <td align="right">国家：</td>
                <td>
                <select name="country">
                    <option value="1">德国</option>
					<option value="2">荷兰</option>
                </select>
                </td>
            </tr>
            <tr>
                <td width="30%" align="right">城市：</td>
                <td><input type="text" class="input2" name="city" maxlength="50" value="<?php echo $city; ?>" /></td>
            </tr>
            <tr>
                <td width="30%" align="right">地址：</td>
                <td><textarea type="text" class="input3" name="address" rows="2" cols="44"><?php echo $address; ?></textarea></td>
            </tr>			
            <tr>
                <td width="30%" align="right">邮编：</td>
                <td><input type="text" class="input2" name="postcode" maxlength="50" value="<?php echo $postcode; ?>" /></td>
            </tr>
			<tr>
                <td width="30%" align="right">联系电话：</td>
                <td><input type="text" class="input2" name="tel" maxlength="50" value="<?php echo $tel; ?>" /></td>
            </tr>
            <tr>
                <td width="30%" align="right">腾讯qq号码：</td>
                <td><input type="text" class="input2" name="qq" maxlength="50" value="<?php echo $qq; ?>" /></td>
            </tr>	
			
            <tr>
                <td height="60">&nbsp;</td>
                <td><input type="submit" class="btn" value="提交"/> <input type="button" class="btn" value="取消" onclick="$.fancybox.close();" /></td>
            </tr>
			
			
        </table>
    </form>
</div>
<script type="text/javascript" src="js/jquery.form.js"></script>
<script type="text/javascript">
$(function(){
	$('#edit_form').ajaxForm({
		beforeSubmit: validate,
		success: function(msg){
			if(msg==1){
				$.fancybox.close();				
				$().message("修改成功");
				self.location.reload(); 
				//$("#list").trigger("reloadGrid");
			}else{
				alert(msg);
			}
		}
	}); 
});
function validate(formData, jqForm, options) {  
    for (var i=0; i < formData.length; i++) { 
        if (!formData[i].value) { 
			$().message("请输入完整相关信息");
            return false; 
        } 
    } 
	$().message("正在提交...");
}
</script>